 //111.二叉树的最小深度
 //https://leetcode.cn/problems/minimum-depth-of-binary-tree/
class Solution {
public:
    int minDepth(TreeNode* root) {
        if(root == nullptr) return 0;
        if(root->left == nullptr && root->right == nullptr) return 1;
        int ret = INT_MAX;
        if(root->left) ret = min(ret,minDepth(root->left));
        if(root->right) ret = min(ret,minDepth(root->right));
        return ret+1;
    }
};